package com.banksystem.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.banksystem.entity.Activity;
import com.banksystem.entity.News;


public interface Activitymapper {

	@Select("insert into activity (name,gname,date1,date2,master,content) values (#{name},#{gname},#{date1},#{date2},#{master},#{content})")
	public void addhd(@Param("name")String name,@Param("gname")String gname,@Param("date1")String date1 ,@Param("date2")String date2,@Param("master")String master,@Param("content")String content);
	
	@Select("select * from activity where gname=#{gname}")
	public List<Activity> findActivityAll(@Param("gname")String gname);
	
	@Select("select * from activity")
	public List<Activity> adminfindActivityAll();
	
	@Delete("delete from activity where aid=#{aid}")
	public void deleteactivity(@Param("aid")String aid);
	
	@Select("select * from activity where gname like'%${gname}%' and ( gname like'%${seach}%' or name like'%${seach}%' or aid like'%${seach}%' or date1 like'%${seach}%'  or date2 like'%${seach}%')")
	public List<Activity> findactivityAlllike(@Param("seach")String seach,@Param("gname")String gname);
}
